package com.ssj.mapper;

import com.ssj.annotation.*;
import com.ssj.entity.GxaUser;
import com.ssj.entity.GxaUserDto;
import com.ssj.entity.GxaUserDto2;

import java.util.Date;
import java.util.HashMap;
import java.util.List;

public interface GxaUserMapper {
    @Select("Select * from gxa_user where id=#{id}")
    GxaUser findUserById(@Param("id") Long id);

    @Select("Select * from gxa_user")
    List<GxaUser> findUser();

    @Insert("Insert into gxa_user(username,password,salt,phone,created,last_login_time,status)\n" +
            "        values(#{username},#{password},#{salt},#{phone},#{created},#{lastLoginTime},#{status})")
    int insertUser(@Param("username") String username, @Param("password") String password, @Param("salt") String salt, @Param("phone") String phone, @Param("created") Date created, @Param("lastLoginTime") Date lastLoginTime,@Param("status") Integer status);
    @Insert("Insert into gxa_user(username,password,salt,phone,created,last_login_time,status)\n" +
            "        values(#{username},#{password},#{salt},#{phone},#{created},#{lastLoginTime},#{status})")
    int insertGxaUser(@Param("gxaUser")GxaUserDto gxaUser);

    @Update("update gxa_user set phone=#{phone} where id=#{id}")
    int updateById(@Param("phone") String phone,@Param("id") Long id);
    
    @Update("update gxa_user set phone=#{phone}")
    int update(@Param("phone") String phone);

    @Delete("Delete from gxa_user where id=#{id}")
    int delete(@Param("id") Long id);

}
